<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<style>
.myUpperCaseClass {color: green}
#myUpperCaseID {color: green}
</style>

<div class="myUpperCaseClass"></div>
<div id="myUpperCaseID"></div>

<script>
test(function() {
  assert_equals(document.styleSheets[0].cssRules[0].cssText, ".myUpperCaseClass { color: green; }");
  assert_equals(document.styleSheets[0].cssRules[1].cssText, "#myUpperCaseID { color: green; }");
  assert_equals(getComputedStyle(myUpperCaseID).color, "rgb(0, 128, 0)");
  var divs = document.getElementsByClassName("myUpperCaseClass");
  assert_equals(divs.length, 1)
  assert_equals(getComputedStyle(divs[0]).color, "rgb(0, 128, 0)");
}, "Test that the CSS rule should serialize to the same case as the one inside the stylesheet when in quirks mode.");
</script>
